<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head><title>TravelDream</title>
	<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'/>
</h:head> 
<body> 
	
	<h:outputStylesheet library="css" name="primefaces-style.css"/>

	<p:panel header="Admin Console">
		<h:panelGrid columns="10" cellpadding="3">
			<h:link outcome="homePage" value="Admin Console"/>
			
			 <h:link outcome="createTravelPackage" value="new package" />  
			  
			  <h:link outcome="newFlight" value="new Flight"/> 
			  
			  <h:link outcome="newHotel" value="new hotel"/> 
			  
			  <h:link outcome="newExcursion" value="new excursion"/>
			  
			  <h:link outcome="showAllPackages" value="show all packages" /> 
			 
			  <h:link outcome="showAllHotels" value="show All Hotels"/> 
			   
			  <h:link outcome="showAllFlights" value="show All flights"/>
			   
			  <h:link outcome="showExcursion" value="show excursions"/> 
			  
			  <h:link outcome="manageCity" value="manage city"/>
			  
	 
			  <h:form>
				<p:commandButton id="logoutButton" value="logout" action="#{logout.logout()}" ajax="false"/>
			</h:form>
		</h:panelGrid>
	</p:panel>
	
	<p:panel header="New Flight" styleClass="blue-header"> 
	<h:form id="addFlight">
        <h:panelGrid id="newFlightPanel" columns="3" cellpadding="5">  
            
            <h:outputText value="id " />  
            <p:inputText value="#{flight.currentFlight.id}"/>
            <h:outputText value="#{flight.errorId}" /> 
            
			
				<h:outputText value="departureCity" />
				<p:selectOneMenu value="#{flight.currentFlight.departureCity}"  panelStyle="width:150px" 
        		 effect="fade" var="p" style="width:160px"  filter="true" filterMatchMode="startsWith">
        		 <f:selectItem itemLabel="Select One" itemValue="" /> 
        		<f:selectItems value="#{cityBean.allCityList}" var="CityDTO" itemLabel="#{CityDTO.city}" itemValue="#{CityDTO.city}"/>
         		</p:selectOneMenu> 
         		<h:outputText value="#{flight.errorDepartureCity}" />
                               
			                   
            <h:outputText value="arrivalCity" />  
     		<p:selectOneMenu value="#{flight.currentFlight.arrivalCity}"  panelStyle="width:150px" 
        		 effect="fade" var="p" style="width:160px"  filter="true" filterMatchMode="startsWith">
        		 <f:selectItem itemLabel="Select One" itemValue="" /> 
        		<f:selectItems value="#{cityBean.allCityList}" var="CityDTO" itemLabel="#{CityDTO.city}" itemValue="#{CityDTO.city}"/>
         		</p:selectOneMenu>
         		<h:outputText value="#{flight.erroreArrivalCity}" /> 
                               
     		
     		<h:outputText value="date" /> 
     		<p:calendar value="#{flight.currentFlight.data}" pattern="MM/dd/yyyy HH:mm" />
     		<h:outputText value="#{flight.errorDate}" />
     		
     		
     		<h:outputText value="Price (EUR)" />
     		<p:inputText id="inputPrice" value="#{flight.currentFlight.price}">
     		</p:inputText>
			<h:outputText value="#{flight.errorPrice}" />        
         
         <p:commandButton value="add" action="#{flight.addFlight()}" update="newFlightPanel"/>  
		<h:outputText value="#{flight.packageCreated}" />
        </h:panelGrid>  
         </h:form> 
    </p:panel> 
	
</body> 
</html>
